<template>
<a-form-item v-bind="$attrs">
  <template #label>
    <span>{{ label }}</span>
    <a-tooltip v-if="needTooltip" :title="tooltip">
      <y-icon icon="fa-solid fa-question-circle"></y-icon>
    </a-tooltip>
  </template>
  <slot />
</a-form-item>
</template>
<script setup>
defineOptions({
  name:"YFormItem"
})
const props = defineProps({
  label: {
    type: String,
    default: ''
  },
  tooltip: {
    type: String,
    default: ''
  },
});
const needTooltip = computed(() => {
  return props.tooltip !== ''
})
</script>